package LanQiao;

public class Demo7 {
    public static void main(String[] args) {
        int count = 0;

        int ret = 2;

        while (count < 2024) {
            if (method(ret)) {
                count++;
            }
            if (count >= 2024) {
                break;
            }
            ret++;
        }

        System.out.println(ret);
    }

    private static boolean method(int num) {
        for (int i = 2; i < num; i++) {
            if (num % i == 0 && 2024 % i == 0) {//num与2024有公约数
                return false;
            }
        }
        return true;
    }
}
